﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace eTMS.UserControls
{
    public partial class KhoanTienCheckList : UserControl
    {
        public KhoanTienCheckList()
        {
            InitializeComponent();
        }
        public void HideCheckColumn()
        {
            Column1.Visible = false;
        }
        private DataTable _Table = null; 
        public void SetDataSource(DataTable table)
        {
            dataGridView1.AutoGenerateColumns = false;
            dataGridView1.DataSource = table;
            _Table = table;
        }
        public DataTable GetData()
        {
            return _Table;
        }
        public void ClearChecked()
        {
            Commons.Common.FillTableColumnValue(_Table, "CHECKED", false);
        }
        public void SetKhoanTienSoTien(int KhoanTien_ID,decimal SoTien)
        {
            DataRow[] rows = _Table.Select("KhoanTien_ID=" + KhoanTien_ID.ToString());
            if(rows.Length>0)
            {
                rows[0]["SoTien"] = SoTien;
                rows[0]["CHECKED"] = true;
            }
        }
    }
}
